home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-05-01 | 21.3 KB | 862 lines | [TEXT/MPS ] |
- // UTranscriptView.cp
- // copyright © 1985-1991 by Apple Computer, Inc. All rights reserved.
-
- #ifndef __STDIO__
- #include <StdIo.h>
- #endif
-
- #ifndef __UGEOMETRY__
- #include <UGeometry.h>
- #endif
-
- #ifndef __ALIASES__
- #include <Aliases.h>
- #endif
-
- #ifndef __UFILE__
- #include <UFile.h>
- #endif
-
- #ifndef __UEVENT__
- #include <UEvent.h>
- #endif
-
- #ifndef __UCOMMAND__
- #include <UCommand.h>
- #endif
-
- #ifndef __UDOCUMENT__
- #include <UDocument.h>
- #endif
-
- #ifndef __USCROLLER__
- #include <UScroller.h>
- #endif
-
- #ifndef __UFAILURE__
- #include <UFailure.h>
- #endif
-
- #ifndef __UMACAPPUTILITIES__
- #include <UMacAppUtilities.h>
- #endif
-
- #ifndef __DIALOGS__
- #include <Dialogs.h>
- #endif
-
- #ifndef __UPATCH__
- #include <UPatch.h>
- #endif
-
- #ifndef __UMEMORY__
- #include <UMemory.h>
- #endif
-
- #ifndef __UMACAPPGLOBALS__
- #include <UMacAppGlobals.h>
- #endif
-
- #ifndef __ERRORS__
- #include <Errors.h>
- #endif
-
- #ifndef __UTRANSCRIPTVIEW__
- #include "UTranscriptView.h"
- #endif
-
- #ifndef __EVENTS__
- #include "Events.h"
- #endif
-
- #if !qDebugTheDebugger
- //$W+
- //$R-
- //$Init-
- //$OV-
- #endif
-
- #if qNames
- //$D+
- #endif
-
- short pInspectLine; // Used to maintain line breaks when
- // inspecting object in DoToField
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal short TTranscriptView::RowToIndex(short row)
- // Returns the row as an index for fLineLengths and fLineStarts
- {
- if (fFirstLineIndex + row < fRows)
- return fFirstLineIndex + row;
- else
- return fFirstLineIndex + row - fRows;
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal short TTranscriptView::IndexToRow(short index)
- // Returns the index as a row
- {
- if (index - fFirstLineIndex >= 0)
- return index - fFirstLineIndex;
- else
- return index - fFirstLineIndex + fRows;
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal short TTranscriptView::IndexToLocal(short index)
- // returns the v-coordinate of the given row
- {
- return kVMargin + (this->IndexToRow(index) + 1) * fFontHeight - fFontInfo.leading - fFontInfo.descent;
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal short TTranscriptView::LocalToIndex(short local)
- // returns the line that contains the v coordinate
- {
- return this->RowToIndex(((local - kVMargin - fFontInfo.leading - fFontInfo.descent) + 1) / fFontHeight);
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::InstallTextStyle(const TextStyle& theStyle)
- {
- FontInfo aFontInfo;
- short theFontHeight;
-
- GetTextStyleFontInfo(theStyle, aFontInfo, theFontHeight);
- fTextStyle = theStyle;
- fFontInfo = aFontInfo;
- fFontHeight = theFontHeight;
-
- this->Resize(VPoint((2 * kVMargin) + (fFontHeight * (fInsertionPt.v + 1)), (2 * kHMargin) + (fCols * fFontInfo.widMax)), kInvalidate);
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::IndexColToLocal(short index,
- short col,
- VPoint& localPoint)
- {
- localPoint.v = this->IndexToLocal(index);
- HLock((Handle)fText);
- localPoint.h = kHMargin + TextWidth(*fText, (*fLineStarts)[index], col);
- HUnlock((Handle)fText);
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal short TTranscriptView::LocalToCol(short local)
- // returns the line that contains the v coordinate
- {
- return ((local - kHMargin) + 1) / fFontInfo.widMax;
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal short TTranscriptView::PrevIndex(short ln)
- // returns the line previous to the line; wrapped circularly
-
- {
- if (ln - 1 < 0)
- return fRows - 1;
- else
- return ln - 1;
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal short TTranscriptView::SuccIndex(short ln)
- // returns the line succeeding the line; wrapped circularly
-
- {
- if (ln + 1 >= fRows)
- return 0;
- else
- return ln + 1;
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::GetInsertionPointRect(VRect& itsRect)
- {
- VPoint pt;
- short insertionPtIndex = this->RowToIndex(fInsertionPt.v);
- this->IndexColToLocal(insertionPtIndex, (*fLineLengths)[insertionPtIndex],pt);
- itsRect = VRect(pt.h, pt.v - fFontInfo.ascent, pt.h + 1, pt.v + fFontInfo.descent);
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWInit
-
- pascal void TTranscriptView::CommonInit(TView* /* itsSuperView */,
- short /* outputFont */,
- short /* outputSize */,
- short numLines,
- short numCharsPerLine)
- {
- FailInfo fi;
- short i;
- VPoint VPt;
-
- fRows = numLines; // # lines in window
- fCols = numCharsPerLine; // chars / line
- fTotal = fRows * fCols; // total chars in window
-
- if (fi.Try())
- {
- fText = (TextHandle)(NewPermHandle(fTotal));
- fLineLengths = (LineLensHandle)(NewPermHandle(fRows * sizeof(short)));
- fLineStarts = (LineLensHandle)(NewPermHandle(fRows * sizeof(short)));
- fi.Success();
- }
- else // Recover
- {
- this->Free();
- fi.ReSignal();
- }
-
- fUpdateRgn = MakeNewRgn();
-
- for (i = 0; i <= fRows - 1; ++i)
- (*fLineLengths)[i] = 0;
-
- for (i = 0; i <= fRows - 1; ++i)
- (*fLineStarts)[i] = 0;
-
- this->InstallTextStyle(gApplicationStyle);
- this->SetIdleFreq(GetCaretTime());
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWInit
-
- pascal void TTranscriptView::ITranscriptView(TView* itsSuperView,
- short outputFont,
- short outputSize,
- short numLines,
- short numCharsPerLine)
- {
- VPoint VPt;
-
- this->IView(NULL, itsSuperView, gZeroVPt, gZeroVPt, sizeFixed, sizeFixed);
- this->CommonInit(itsSuperView, outputFont, outputSize, numLines, numCharsPerLine);
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWInit
- pascal void TTranscriptView::Initialize(void) // override
- {
-
- inherited::Initialize();
- fCols = 100;
- fFirstLineIndex = 0;
- fFontHeight = 9;
-
- //!!! fFontInfo: FontInfo;
-
- fForcePtr = 0;
-
- //!!! fForceStack: ARRAY [1..kForceDepth] OF ForceState;
- fHelpProc = NULL;
- fInsertionPointOn = FALSE;
- fInsertionPt = gZeroPt;
- fLastInsertionPointTime = 0;
- fLineLengths = NULL;
- fLineStarts = NULL;
- fRows = 120;
- fText = NULL;
- fTextStyle = gApplicationStyle;
- fTotal = fRows * fCols; // total chars in window
- fRedirectFile = NULL;
- fUpdateRgn = NULL;
- fWrToFile = TRUE;
- fWrToWindow = TRUE;
-
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWInit
-
- pascal void TTranscriptView::IRes(TDocument* itsDocument,
- TView* itsSuperView,
- Ptr& itsParams)
- {
-
- inherited::IRes(itsDocument, itsSuperView, itsParams);
- this->CommonInit(itsSuperView, 1, 9, 120, 100);
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment MAHelp
-
- pascal void TTranscriptView::DoHelp(TToolboxEvent*/* event */ ,
- long& /* message */)
- {
- if (fHelpProc)
- fHelpProc();
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::RevealInsertionPoint(void)
- {
- if (this->Focus())
- {
- VRect insertionRect;
-
- SetPortTextStyle(fTextStyle);
- this->GetInsertionPointRect(insertionRect);
- this->RevealRect(insertionRect, VPoint(fFontHeight + kVMargin, fFontInfo.widMax), kRedraw);
- }
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::RevealInsertionPointLine(void)
-
- {
- VRect vr;
-
- this->GetInsertionPointRect(vr);
- vr.left = fLocation.h;
-
- this->RevealRect(vr, VPoint(fFontHeight + kVMargin, 0), kRedraw);
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::AddText(Ptr textBuf,
- short byteCount)
- {
- unsigned char ch;
- long count;
- Boolean gotBS;
- Boolean gotEOL;
- VPoint pt;
- Rect qdr;
- short startCount;
- Ptr startPtr;
- VRect vr;
- short newOffset;
- short startLength;
- TScroller * aScroller;
- short insertionPtIndex;
- Boolean doInfiniteScroll;
-
- if (fWrToFile && (fRedirectFile))
- {
- count = byteCount;
- fRedirectFile->WriteData(textBuf, count);// Disregard the error for now
- }
-
- if (fWrToWindow)
- // draw as many lines as we got
- while (byteCount)
- {
- gotEOL = FALSE;
- gotBS = FALSE;
- startPtr = textBuf;
- startCount = byteCount;
- insertionPtIndex = this->RowToIndex(fInsertionPt.v);
- startLength = (*fLineLengths)[insertionPtIndex];
-
- // Scan for a chunk to save
- while ((byteCount) && ((*fLineLengths)[insertionPtIndex] < fCols) && (!gotEOL) && (!gotBS))
- {
- --byteCount;
- switch (ch = *(textBuf++))
- {
- case kWWEol:
- gotEOL = TRUE;
- break;
-
- case chBackspace:
- gotBS = TRUE;
- break;
-
- default:
- (*fText)[(*fLineStarts)[insertionPtIndex] + ((*fLineLengths)[insertionPtIndex]++)] = ch;
- }
- }
-
- // Draw the chunk if possible
- if (this->Focus())
- {
- SetPortTextStyle(fTextStyle);
- if (!gotBS)
- {
- VPoint vp;
- this->IndexColToLocal(insertionPtIndex, startLength,vp);
- Point qdPoint = this->ViewToQDPt(vp);
- MoveTo(qdPoint.h, qdPoint.v);
- if (gotEOL) // don't draw the EOL character
- DrawText(startPtr, 0, (startCount - byteCount) - 1);
- else
- DrawText(startPtr, 0, startCount - byteCount);
-
- }
- else
- {
- if ((*fLineLengths)[insertionPtIndex])/* don't backspace past beginning of line! */
- {
- VRect r2;
- VRect r;
-
- this->GetInsertionPointRect(r2);
- (*fLineLengths)[insertionPtIndex]--;
- this->GetInsertionPointRect(r);
- r.right = r2.right;
- this->InvalidateVRect(r);
- }
- }
- }
-
- // handle newline and line wrap if any
- if (gotEOL || ((*fLineLengths)[insertionPtIndex] >= fCols))
- {
- // set the starting offset of the next line in the buffer
- newOffset = (*fLineStarts)[insertionPtIndex] + (*fLineLengths)[insertionPtIndex] + 1;
- if (newOffset >= (fTotal - fCols))// save space for a full line
- newOffset = 0;
-
- fInsertionPt.v++;
- if (fInsertionPt.v == fRows)
- {
- fInsertionPt.v = fRows - 1;
- fFirstLineIndex = this->SuccIndex(fFirstLineIndex);
- doInfiniteScroll = TRUE;
- }
- else
- doInfiniteScroll = FALSE;
- insertionPtIndex = this->SuccIndex(insertionPtIndex);
-
- (*fLineStarts)[insertionPtIndex] = newOffset;// offset to store text at
- (*fLineLengths)[insertionPtIndex] = 0;// new line starts out zero length
-
- if (this->Focus())
- {
- aScroller = this->GetScroller(FALSE);
- if (aScroller->fTranslation == aScroller->fMaxTranslation) // already scrolled to max
- {
- if (doInfiniteScroll)
- {
- this->GetDrawableQDRect(qdr);
- ScrollRect(qdr, 0, -fFontHeight, fUpdateRgn);
- }
- }
- else
- {
- if (doInfiniteScroll)
- // pretend we're up a line
- {
- fViewToQDOffset.v = Max(fViewToQDOffset.v - fFontHeight, 0);
-
- aScroller->fTranslation.v = Max(aScroller->fTranslation.v - fFontHeight, 0);
- }
- this->RevealInsertionPointLine();
- }
- }
-
- // Dynamic sizing of view
- if (fInsertionPt.v < fRows)
- this->Resize(VPoint((2 * kVMargin) + (fFontHeight * (fInsertionPt.v + 1)), (2 * kHMargin) + (fCols * fFontInfo.widMax)), kDontInvalidate);
-
- }
- this->Update(); // Make sure everything is nice and visible
- }
- }
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::EndForce(void)
- {
- if (fForcePtr)
- {
- fWrToWindow = fForceStack[fForcePtr].toWindow;
- fWrToFile = fForceStack[fForcePtr].toFile;
- --fForcePtr;
- }
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::ForceOutput(WrForceOptions wrToWindow,
- WrForceOptions wrToFile)
- {
- if (fForcePtr < kForceDepth)
- {
- ++fForcePtr;
-
- fForceStack[fForcePtr].toWindow = fWrToWindow;
- fForceStack[fForcePtr].toFile = fWrToFile;
-
- if (wrToWindow != WrForceUnchanged)
- fWrToWindow = wrToWindow == WrForceOn;
-
- if (wrToFile != WrForceUnchanged)
- fWrToFile = wrToFile == WrForceOn;
- }
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal OSErr TTranscriptView::CloseRedirect(void)
- {
- OSErr err;
- long fileMark;
-
- err = noErr;
- if (fRedirectFile)
- {
- err = fRedirectFile->GetDataMark(fileMark);
- err = fRedirectFile->SetDataLength(fileMark);
- err = fRedirectFile->CloseFile(TRUE);
- if (err != noErr)
- err = fRedirectFile->FlushVolume();
- fRedirectFile = (TFile *)(FreeIfObject(fRedirectFile));
- }
- return err;
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal TFile* TTranscriptView::DoMakeFile(void)
- {
- TFile * redirectFile;
-
- redirectFile = NewFile();
- redirectFile->DefineFile('TEXT', 'MPS ', TRUE, FALSE, TRUE, FALSE);
- redirectFile->SetPermissions(fsRdWrPerm, fsRdWrPerm);
- return redirectFile;
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal OSErr TTranscriptView::Redirect(const Str255& fileName)
- {
- OSErr err;
- Boolean wantToAppend;
- long fileLength;
- OSType fileType;
- Str255 aFileName;
- OSErr result;
-
- result = noErr;
-
- err = this->CloseRedirect();
-
- if (fileName)
- {
- aFileName = fileName;
- wantToAppend = aFileName.Pos(">>") == 1;
- if (wantToAppend)
- {
- // aFileName = Copy((*fileName), 3, fileName.Length() - 2);
- aFileName.Delete(1, 2);
- }
- else
- aFileName = fileName;
-
- if (!aFileName.IsEmpty())
- {
- fRedirectFile = this->DoMakeFile();
- if (fRedirectFile)
- {
- err = fRedirectFile->IdentifyByTrio(0, 0, aFileName);
- err = fRedirectFile->CreateFile();
-
- if (err == dupFNErr)
- {
- err = fRedirectFile->GetFileType(fileType);
- if (err == noErr)
- if (fileType != 'TEXT')
- err = dupFNErr;
- }
-
- if (err == noErr)
- {
- err = fRedirectFile->OpenFile();
-
- if (wantToAppend)
- {
- err = fRedirectFile->GetDataLength(fileLength);
- err = fRedirectFile->SetDataMark(fileLength, fsFromStart);
- }
- }
- else
- result = err;
- }
- }
- }
- return result;
- }
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::Scroll(short howManyLines)
- {
- if (howManyLines)
- this->GetScroller(FALSE)->ScrollBy(VPoint(howManyLines * fFontHeight, 0), kRedraw);
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::DoKeyCommand(TToolboxEvent* event)// override
- {
- long message;
- Rect insertionPointQDRect;
- VRect insertionRect;
-
- this->Focus();
- this->GetInsertionPointRect(insertionRect);
- this->ViewToQDRect(insertionRect, insertionPointQDRect);
- EraseRect(insertionPointQDRect);
-
- switch (event->fCharacter)
- {
- case chPageUp:
- case chPageDown:
- case chHome:
- case chEnd:
- inherited::DoKeyCommand(event);
- break;
-
- case chDown:
- this->Scroll(1);
- break;
-
- case chUp:
- this->Scroll(-1);
- break;
-
- case chHelp:
- if (fHelpProc)
- this->DoHelp(event, message);
- else
- inherited::DoKeyCommand(event);
- break;
-
- default:
- inherited::DoKeyCommand(event);
- break;
- }
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal Boolean TTranscriptView::DoIdle(IdlePhase phase)// override
- {
- Rect insertionPointQDRect;
-
- if ((phase == idleContinue) && this->Focus())
- {
- if (this->IsActive())
- SetPortTextStyle(fTextStyle);
- if ((TickCount() - fLastInsertionPointTime) >= GetCaretTime())
- {
- VRect insertionRect;
-
- this->GetInsertionPointRect(insertionRect);
- this->ViewToQDRect(insertionRect, insertionPointQDRect);
- fLastInsertionPointTime = TickCount();
- if (fInsertionPointOn)
- EraseRect(insertionPointQDRect);
- else
- FillRect(insertionPointQDRect, qd.black);
- fInsertionPointOn =!fInsertionPointOn;
- }
- }
- return FALSE;
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
- //!!! Former nested routine
- typedef pascal void(* PrintFieldType)(const Str255& theLabel,
- const Str255& theString,
- void* theData,
- short theType,
- void* staticLink);
- class CPrintField
- {
- short fCols;
- public:
- // Constructor
- CPrintField(short cols) :
- fCols(cols)
- {
- }
-
- pascal void PrintField(const Str255& theLabel,
- const Str255& theString,
- void* /*theData*/,
- short /*theType*/);
- };
-
- #pragma segment WWSeg
- pascal void CPrintField::PrintField(const Str255& theLabel,
- const Str255& theString,
- void* /*theData*/,
- short /*theType*/)
- {
- short fieldSize;
-
- fieldSize = theLabel.Length() + theString.Length() + 2;
- if ((pInspectLine + fieldSize + 2) >= fCols)
- {
- fprintf(stderr, "\n");
- pInspectLine = 0;
- }
- else if (pInspectLine) // If not at the start of a line
- {
- fprintf(stderr, " ");
- pInspectLine = pInspectLine + 2;
- }
-
- if (theLabel.Length())
- fprintf(stderr, "%s: ", (char*)theLabel);
-
- fprintf(stderr, "%s", (char*)theString);
- pInspectLine = pInspectLine + fieldSize;
- }
-
- #pragma segment WWSeg
- pascal void TTranscriptView::DoToField(const Str255& fieldName,
- void* fieldAddr,
- short fieldType)
- {
- if (fieldType == bClass)
- {
- fprintf(stderr, "\n");
- fprintf(stderr, "%s:\n", (char*)fieldName);
- pInspectLine = 0;
- }
- else
- {
- CPrintField aCPrintField(fCols);
-
- FieldToString(fieldName, fieldAddr, fieldType, (PrintFieldType) & CPrintField::PrintField, &aCPrintField);
- }
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment WWSeg
-
- pascal void TTranscriptView::Draw(const VRect& area)// override
- {
- short currIndex; // index of line to draw
- short y; // y coord to draw at
- Rect qdArea;
-
- this->ViewToQDRect(area, qdArea);
-
- SetPortTextStyle(fTextStyle);
-
- currIndex = this->LocalToIndex(qdArea.top);
- y = this->IndexToLocal(currIndex); // initial y coordinate snapped to a row
-
- HLock((Handle)fText);
- do
- {
- MoveTo(kHMargin, y);
- DrawText(*fText, (*fLineStarts)[currIndex], (*fLineLengths)[currIndex]);
- currIndex = this->SuccIndex(currIndex);
- y += fFontHeight;
- } while (((y - fFontInfo.ascent) <= qdArea.bottom) && (currIndex != fFirstLineIndex));
- HUnlock((Handle)fText);
-
- inherited::Draw(area);
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment MAClose
-
- pascal void TTranscriptView::Free(void) // override
- {
- fText = (TextHandle)(DisposeIfHandle((Handle)fText));
- fLineLengths = (LineLensHandle)(DisposeIfHandle((Handle)(fLineLengths)));
- fLineStarts = (LineLensHandle)(DisposeIfHandle((Handle)(fLineStarts)));
- fRedirectFile = (TFile *)(FreeIfObject(fRedirectFile));
-
- inherited::Free();
- }
-
- //--------------------------------------------------------------------------------------------------
- #pragma segment BBFields
-
- pascal void TTranscriptView::Fields(TObject* obj)// override
- {
- Str255 s;
-
-
- obj->DoToField("TTranscriptView", NULL, bClass);
-
- obj->DoToField("fWrToWindow", &fWrToWindow, bBoolean);
- obj->DoToField("fWrToFile", &fWrToFile, bBoolean);
- obj->DoToField("fCols", &fCols, bInteger);
- obj->DoToField("fRows", &fRows, bInteger);
- obj->DoToField("fTotal", &fTotal, bInteger);
- obj->DoToField("fText", &fText, bHandle);
- obj->DoToField("fLineLengths", &fLineLengths, bHandle);
- obj->DoToField("fLineStarts", &fLineStarts, bHandle);
-
- obj->DoToField("fFirstLineIndex", &fFirstLineIndex, bInteger);
-
- obj->DoToField("fTextStyle", &fTextStyle, bTextStyle);
-
- obj->DoToField("fFontHeight", &fFontHeight, bInteger);
- obj->DoToField("fFontInfo", NULL, bTitle);
- obj->DoToField(" ascent", &fFontInfo.ascent, bInteger);
- obj->DoToField(" descent", &fFontInfo.descent, bInteger);
- obj->DoToField(" widMax", &fFontInfo.widMax, bInteger);
- obj->DoToField(" leading", &fFontInfo.leading, bInteger);
-
- obj->DoToField("fRedirectFile", &fRedirectFile, bObject);
-
- obj->DoToField("fHelpProc", &fHelpProc, bPointer);
- obj->DoToField("fLastInsertionPointTime", &fLastInsertionPointTime, bLongInt);
- obj->DoToField("fInsertionPointOn", &fInsertionPointOn, bBoolean);
- obj->DoToField("fInsertionPt", &fInsertionPt, bPoint);
- obj->DoToField("fUpdateRgn", &fUpdateRgn, bRgnHandle);
-
- obj->DoToField("fForcePtr", &fForcePtr, bInteger);
- obj->DoToField("fForceStack", NULL, bTitle);
- for (short i = 1; i <= kForceDepth; ++i)
- {
- ConcatNumber(" [", i, s);
- s += "].toWindow";
- obj->DoToField(s, &fForceStack[i].toWindow, bBoolean);
- ConcatNumber(" [", i, s);
- s += "].toFile";
- obj->DoToField(s, &fForceStack[i].toFile, bBoolean);
- }
-
- inherited::Fields(obj);
- }
-
-
-